<template>
<div class="divbox">
    <div class="box">
        <div class="top">
            <div class="topT">
                <div>中国移动</div>
                <div>19:00</div>
                <div>82%</div>
            </div>
            <div class="topC">
                <div>饿了么</div>
                <div>...</div>
            </div>
            <div class="topInput">
                <input type="text" placeholder="输入商家，商家名称">
            </div>
        </div>
    </div>
    <div class="swiper">
        <img src="https://ts1.cn.mm.bing.net/th/id/R-C.1da2dd9b48469d9b33a40f3863300d5f?rik=OusenBLSSZBFRA&riu=http%3a%2f%2fimg.yunhuzx.com%2ffiles%2fuploads%2f2021%2f03-24%2f161657829791f8bc374924.png&ehk=k0fbq0Hca0XqUV7sObt2CGXlDgHoHnXfhti6%2bo2sKyQ%3d&risl=&pid=ImgRaw&r=0"
            alt="">
    </div>
    <div class="like">猜你喜欢</div>
    <div class="features">
        <div v-for="(item,index) in arr1" :key="index">{{item}}</div>
    </div>
    <div class="actives">
        <div v-for="(item,index) in arr2" :key="index">{{item}}</div>
    </div>
    <div class="shopp" v-for="(item,index) in lists" :key="index">
        <div class="leftbox">
            <img :src="item.picUrl" alt="">
        </div>
        <div class="rightbox">
            <div class="name">{{item.name}}</div>
            <div class="num">
                <div>{{item.monthSalesTip}}</div>
                <div>{{item.deliveryTimeTip}} {{item.distance}}</div>
            </div>
        </div>
    </div>
</div>
</template>

<script>
import { shop_list } from '../../utils/api'

export default {
    data() {
        return {
            lists: [],
            arr1: ['综合排序', '距离最近', '销量最高', '筛选'],
            arr2: ['年货节热卖', '津贴联盟', '满减优惠', '品质联盟']
        }
    },
    mounted() {
        shop_list({}).then((res) => {
            this.lists = res.data.list;
            console.log(this.lists);
        })
       
    }
}
</script>

<style lang="scss" scoped>
.box {
    background-color: skyblue;
}

.top {
    width: 95%;
    margin: auto;
}

.top .topT {
    display: flex;
    justify-content: space-between;
    width: 100%;
}

.topC {
    display: flex;
    justify-content: space-between;
    width: 100%;
    border: 8px 0;
}

.topInput input {
    width: 100%;
    height: 40px;
    text-align: center;
    border-radius: 8px;
    background-color: white;
    line-height: 40px;
    border: none;
    outline: none;
    margin-top: 4px;
}

.swiper {
    background-color: white;
}

.swiper img {
    width: 80%;
    margin: 10px 10%;
}

.like {
    background-color: white;
    width: 95%;
    margin: 4px 2.5%;
}

.features {
    width: 95%;
    margin: 0 2.5%;
    display: flex;
    justify-content: space-between;
    background-color: white;
}

.actives {
    width: 95%;
    margin: 0 2.5%;
    display: flex;
    justify-content: space-between;
    background-color: white;
}

.actives div {
    background-color: rgb(129, 125, 125);
    margin: 4px;
}

.shopp {
    display: flex;
    justify-content: space-between;
    width: 95%;
    margin: 4px 2.5%;
}

.shopp .leftbox {
    width: 80px;
    height: 80px;
}

.shopp .leftbox img {
    width: 100%;
}

.shopp .rightbox .num {
    display: flex;
    justify-content: space-between;
}

.shopp .rightbox {
    text-align: left;
    width: 253px;
}
</style>